package csu.web.mypetstore.persistence;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {
    private static final String DRIVER = "com.mysql.jdbc.Driver";

    private static final String URL = "jdbc:mysql://127.0.0.1:3306/demo?useSSL=false";

    private static final String USERNAME = "root";

    private static final String PASSWORD = "123456";

    public static Connection getConnection(){
        Connection connection = null;
        try {
            Class.forName(DRIVER);
            connection = DriverManager.getConnection(
                    URL,USERNAME,PASSWORD);
        }catch (Exception e)
        {
            e.printStackTrace();
        }

        return connection;
    }

    public static void main(String[] args) {
        System.out.println(getConnection());
    }
}
